home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / Wave / WavesWorld / Source / Libraries / tcl7.4b3 / doc / lrange.n < prev    next >
Encoding:
Text File  |  1995-01-30  |  1.4 KB  |  42 lines

  1. '\"
  2. '\" Copyright (c) 1993 The Regents of the University of California.
  3. '\" Copyright (c) 1994-1995 Sun Microsystems, Inc.
  4. '\"
  5. '\" See the file "license.terms" for information on usage and redistribution
  6. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  7. '\" 
  8. '\" @(#) lrange.n 1.4 95/01/30 10:35:43
  9. '\" 
  10. .so man.macros
  11. .HS lrange tcl 7.4
  12. .BS
  13. '\" Note:  do not modify the .SH NAME line immediately below!
  14. .SH NAME
  15. lrange \- Return one or more adjacent elements from a list
  16. .SH SYNOPSIS
  17. \fBlrange \fIlist first last
  18. .BE
  19.  
  20. .SH DESCRIPTION
  21. .PP
  22. \fIList\fR must be a valid Tcl list.  This command will
  23. return a new list consisting of elements
  24. \fIfirst\fR through \fIlast\fR, inclusive.
  25. .VS
  26. \fIFirst\fR or \fIlast\fR
  27. .VE
  28. may be \fBend\fR (or any abbreviation of it) to refer to the last
  29. element of the list.
  30. If \fIfirst\fR is less than zero, it is treated as if it were zero.
  31. If \fIlast\fR is greater than or equal to the number of elements
  32. in the list, then it is treated as if it were \fBend\fR.
  33. If \fIfirst\fR is greater than \fIlast\fR then an empty string
  34. is returned.
  35. Note: ``\fBlrange \fIlist first first\fR'' does not always produce the
  36. same result as ``\fBlindex \fIlist first\fR'' (although it often does
  37. for simple fields that aren't enclosed in braces); it does, however,
  38. produce exactly the same results as ``\fBlist [lindex \fIlist first\fB]\fR''
  39.  
  40. .SH KEYWORDS
  41. element, list, range, sublist
  42.